home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 23 code / ProjectDrag 1.1b4 / Sources / ProjectDrag Sources / PDUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  4.1 KB  |  135 lines  |  [TEXT/MPS ]

  1. /* PDUtilities.h: Utility routines and resource declarations for ProjectDrag
  2.  *
  3.  * A set of applets for drag and drop source control by Tim Maroney.
  4.  * See develop, issue 23 for details.
  5.  *
  6.  * Built on DropShell by Leonard Rosenthol, Stephan Somogyi, and Marshall Clow,
  7.  * and using the MoreFiles utilities by Jim Luther.
  8.  *
  9.  * This software is free, but don't modify and redistribute it without
  10.  * changing the status window to indicate your name and your changes!
  11.  */
  12.  
  13. #ifndef __PDUTILITIES__
  14. #define __PDUTILITIES__
  15.  
  16. #include <Types.h>
  17. #include <Files.h>
  18.  
  19.  
  20. #define kSelectWithPromptDialog 212
  21.  
  22.  
  23. #define kProjectDragStrings 101
  24. #define kPrefsFolderName 1
  25. #define kPrefsFileName 2
  26. #define kWhatYouChangedIn 3
  27. #define kWhatYouWillDoWith 4
  28. #define kNoUserSettings 5
  29. #define kCantGetCKID 6
  30. #define kCantFindProject 7
  31. #define kProjectorError 8
  32. #define kProjectorOutput 9
  33. #define kIdleStatus 10
  34. #define kMountStatus 11
  35. #define kTimsByline 12
  36. #define kAddHeader 13
  37. #define kAnErrorOccured 14
  38. #define kFirstCheckedIn 15
  39. #define kFindingSourceServer 16
  40. #define kCantAddComment 17
  41. #define kExplainChange 18
  42. #define kConfirmDiscardChanges 19
  43. #define kNoCheckInPermission 20
  44. #define kNoCheckOutPermission 21
  45. #define kNoMROPermission 22
  46. #define kCantWritePrefs 23
  47. #define kGettingUserName 24
  48. #define kAddingChangeComment 25
  49. #define kFindingProject 26
  50. #define kSelectDB 27
  51. #define kCantFindProjectCanYou 28
  52. #define kMROCommentFailedCancel 29
  53. #define kCheckoutCommentFailedCancel 30
  54. #define kNameMappingFile 31
  55. #define kConfirmAddFile 32
  56.  
  57. // The structure of a Projector 'ckid' resource
  58.  
  59. typedef struct {
  60.     unsigned long    checkSum;
  61.     long            LOC;                /* location identifier */
  62.     short            version;            /* ckid version number */
  63.     short            writeable;            /* Check out state */
  64.     char            branch;                /* if modifiable & true then branch was made on check out */
  65.     Boolean            modifyReadOnly;        /* did user execute “ModifyReadOnly” on this file? */
  66.  
  67.     unsigned long    unused;
  68.     unsigned long    checkoutTime;        /* date and time of checkout */
  69.     unsigned long    modificationTime;    /* mod date of file */
  70.     
  71.     unsigned long    projectIdA;            /* PID.a */
  72.     unsigned long    projectIdB;            /* PID.b */
  73.     
  74.     short            userId;                /* user ID */
  75.     short            fileId;                /* file ID */
  76.     short            revisionId;            /* rev ID */
  77.     
  78.     Str255            projectPath;        /* Project path -- variable size! */
  79.     
  80.     /* These fields cannot be represented in a struct
  81.     ** but are listed here as documentation:
  82.     
  83.     char;                                /* Byte = 0 *
  84.     PString            userName;            /* User name *
  85.     char;                                /* Byte = 0 *
  86.     PString            revisionNumber;        /* Revision number *
  87.     char;                                /* Byte = 0 *
  88.     PString            fileName;            /* File name *
  89.     char;                                /* Byte = 0 *
  90.     PString            task;                /* task *
  91.     char;                                /* Byte = 0 *
  92.     PString            comment;            /* comment *
  93.     char;                                /* Byte = 0 *
  94.  
  95.     **/
  96.     
  97. } CKIDRec, *CKIDPtr, **CKIDHandle;
  98.  
  99. typedef char *CString;
  100. typedef CString *CStringPtr, **CStringHandle;
  101.  
  102. OSErr ExtractCKID(FSSpec *file, CKIDHandle *theCKID);
  103.  
  104. OSErr FindPreferencesFolder(short *vRefNum, long *folderID);
  105.  
  106. void AppendString(unsigned char *original, unsigned char *append);
  107.  
  108. OSErr MakeFullPathName(FSSpec *spec, Str255 fullPathName);
  109.  
  110. OSErr ProcessFileOrFolder(FSSpec *spec, void (*doFile)(FSSpec *spec, Boolean doingFolde),
  111.                          OSErr (*doFolder)(short vRefNum, long folderID,
  112.                                            void (*doFile)(FSSpec *spec, Boolean doingFolde)));
  113.     
  114. OSErr ProcessFolder(short vRefNum, long folderID, void (*doFile)(FSSpec *spec, Boolean doingFolde));
  115.  
  116. pascal Boolean ProjectDragIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
  117.  
  118. short ReplaceString(Handle baseText, StringPtr key, StringPtr substitutionText);
  119.  
  120. void ReplaceInIndString(StringPtr stringOut, short strListID, short strIndex,
  121.                         StringPtr param1, StringPtr param2,
  122.                         StringPtr param3, StringPtr param4);
  123.                         
  124. long LineSize(StringPtr theLine, long maxSize);
  125.  
  126. Boolean MatchLineUntilChar(StringPtr line1, long len1, StringPtr line2, long len2, char untilChar);
  127.  
  128. Boolean MatchLine(StringPtr line1, long len1, StringPtr line2, long len2);
  129.  
  130. OSErr GetFileData(FSSpec *file, Handle *fileData, short *refNum);
  131.  
  132. OSErr WriteFileWithHeader(short refNum, Handle fileData, long startOffset, StringHandle header);
  133.  
  134. #endif
  135.